<?php


namespace app\project\validate;


use think\Validate;

class Config extends Validate
{
    protected $rule =   [
        'title' => 'require',
        'key'  => 'require|regex:^[a-zA-Z]\w{0,39}$|unique:admin_config',
        'value' => 'require|number|max:100',
    ];

    protected $message  =   [
        'title.require' => '标题必须',
        'key.require' => '配置名称必须',
        'key.regex' => '配置名称由字母和下划线组成',
        'value.require' => '配置值必须',
        'value.number' => '配置值必须为数字',
        'value.max' => '配置值最大100',

    ];
}